package com.xuecheng.manage_course;

import com.xuecheng.framework.interceptor.FeignClientInterceptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author ShengJinFeng
 * @version V1.0
 * @ClassName ManagerCourseApplicatiion
 * @Description (这里用一句话描述这个类的作用)
 * @date 2020/2/1 10:49
 * @since V1.0
 */
@SpringBootApplication
@EntityScan("com.xuecheng.framework.domain.course")//扫描实体类
@ComponentScan(basePackages={"com.xuecheng.api"})//扫描接口
@ComponentScan(basePackages={"com.xuecheng.manage_course"})
@ComponentScan(basePackages={"com.xuecheng.framework"})//扫描common下的所有类
@EnableEurekaClient
@EnableFeignClients
public class ManagerCourseApplicatiion {
    public static void main(String[] args) {
        SpringApplication.run(ManagerCourseApplicatiion.class,args);
    }

    /**
     * @Description 注入feign过滤器
     * @author ShengJinFeng
     * @date 2020/3/13
     */
    @Bean
    public FeignClientInterceptor feignClientInterceptor(){
        return new FeignClientInterceptor();
    }
}
